package com.qfedu.openplateform.manager.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qfedu.openplateform.manager.dao.UserTokenMapper;
import com.qfedu.openplateform.manager.entity.UserToken;
import com.qfedu.openplateform.manager.service.UserTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserTokenServiceImpl implements UserTokenService {

    @Autowired
    private UserTokenMapper userTokenMapper;

    @Override
    public PageInfo<UserToken> getUserTokenList(UserToken userToken, Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        return new PageInfo<>(userTokenMapper.getUserTokenList(userToken));
    }

    @Override
    public void addUserToken(UserToken userToken) {
        userTokenMapper.addUserToken(userToken);
    }

    @Override
    public void updateUserToken(UserToken userToken) {
        userTokenMapper.updateUserToken(userToken);
    }

    @Override
    public void deleteUserToken(Integer[] ids) {
        userTokenMapper.deleteUserToken(ids);
    }
}
